// Copyright Epic Games, Inc. All Rights Reserved.

#pragma once

#include "Components/Widget.h"
#include "GameplayTagContainer.h"

#include "HitMarkerConfirmationWidget.generated.h"

class SHitMarkerConfirmationWidget;
class SWidget;
class UObject;
struct FGameplayTag;

UCLASS()
class UHitMarkerConfirmationWidget : public UWidget
{
	GENERATED_BODY()

public:
	UHitMarkerConfirmationWidget(const FObjectInitializer& ObjectInitializer);

	//~UWidget 接口
protected:
	/**
	 * 重新构建 Slate 控件
	 */
	virtual TSharedRef<SWidget> RebuildWidget() override;
	//~UWidget 接口结束

	//~UVisual 接口
public:
	/**
	 * 释放 Slate 资源
	 * @param bReleaseChildren 是否同时释放子资源
	 */
	virtual void ReleaseSlateResources(bool bReleaseChildren) override;
	//~UVisual 接口结束
	
public:
	/** 显示命中提示的持续时间（秒）（在此期间会逐渐变为透明） */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Appearance, meta=(ClampMin=0.0, ForceUnits=s))
	float HitNotifyDuration = 0.4f; //命中提示持续时间

	/** 为单个命中标记绘制的标记图像 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Appearance)
	FSlateBrush PerHitMarkerImage; //每个命中标记图像

	/** 从区域标签（例如，弱点）到单个位置命中的覆盖标记图像的映射 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category=Appearance)
	TMap<FGameplayTag, FSlateBrush> PerHitMarkerZoneOverrideImages; //每个命中标记区域覆盖图像

	/** 如果有任何命中，则绘制的标记图像 */
	UPROPERTY(EditAnywhere, BlueprintReadOnly, Category = Appearance)
	FSlateBrush AnyHitsMarkerImage; //任意命中标记图像

private:
	/** 内部 Slate 控件，表示实际的标记视觉效果 */
	TSharedPtr<SHitMarkerConfirmationWidget> MyMarkerWidget; //我的标记控件
};